package com.becca.cake.service.statistcs;

import java.util.List;
import java.util.Map;

import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;

import org.springframework.dao.DataAccessException;

import com.becca.cake.core.exception.ServiceException;
import com.becca.cake.model.order.OrderModel;
import com.becca.cake.model.statistics.OrderTypeCountModel;
import com.becca.cake.model.statistics.SaleReportModel;
import com.becca.cake.model.statistics.UserConsumptionModel;

/**
 * 
 * @author yellow
 *
 */
public interface IStatisticsService {
    /**
     * 统计订单商品数量
     * @param map
     * @return
     * @throws ServiceException
     */
    List<OrderModel> selectSatasticOrderGoods(Map<String, Object> map) throws ServiceException;

    /**
     * Excel订单导出
     * @param deliveryDate
     */
    void exportStatisticsOrder(HttpServletRequest request, HttpServletResponse response,
                               String deliveryDate);

    /**
     * 统计订单优惠码使用情况
     * @param map
     * @return
     * @throws DataAccessException
     */
    List<OrderModel> selectSatasticCouponCode(Map<String, Object> map) throws DataAccessException;

    /**
     * Excel优惠码导出
     * @param deliveryDate
     */
    void exportStatisticsCouponCode(HttpServletRequest request, HttpServletResponse response,
                                    String couponCode, String statisticCouponCodeStartDate,
                                    String statisticCouponCodeEndDate);

    /**
     * 订单类型统计图表
     * @param radioDay
     * @param orderPieStartDate
     * @param orderPieEndDate
     * @return
     */
    List<OrderTypeCountModel> selectCountOrderByOrderType(Integer radioDay,
                                                          String orderPieStartDate,
                                                          String orderPieEndDate);

    /**
     * 订单销售金额统计图表
     * @param radioDay
     * @param orderPieStartDate
     * @param orderPieEndDate
     * @return
     */
    Map<String, Object> selectCountOrderAmountByOrderType(Integer radioDay,
                                                          String orderPieStartDate,
                                                          String orderPieEndDate);

    /**
     * SKU商品统计
     * @param radioDay
     * @param orderPieStartDate
     * @param orderPieEndDate
     * @return
     */
    List<OrderTypeCountModel> selectCountOrderBySku(Integer radioDay, String orderPieStartDate,
                                                    String orderPieEndDate);

    /**
     * 查询订单统计报表数据
     * @param radioDay
     * @param orderPieStartDate
     * @param orderPieEndDate
     * @return
     */
    OrderModel selectOrderReportInfo(Integer radioDay, String orderPieStartDate,
                                     String orderPieEndDate);

    /**
     * 订单增长统计
     * @param radioDay
     * @param orderStartDate
     * @param orderEndDate
     * @return
     */
    Map<String, Object> selectOrderRoseChart(Integer radioDay, String orderStartDate,
                                             String orderEndDate);

    /**
     * 查询全部有效订单地址订单
     * @return
     */
    List<OrderModel> selectAllOrderAddressPoint(String orderTypes);
    
    /**
     * 统计销售报表
     * @param map
     * @return
     * @throws ServiceException
     */
    List<SaleReportModel> selectSatasticOrderSale(Map<String, Object> map) throws ServiceException;
    
    /**
     * 用户消费统计
     * @param map
     * @return
     */
    List<UserConsumptionModel> selectUserConsumption(Map<String,Object> map)throws ServiceException;
    
    /**
     * 用户消费统计总数
     * @param map
     * @return
     */
    long selectUserConsumptionCount(Map<String,Object> map)throws ServiceException;
    
    /**
     * 用户消费详情统计
     * @param map
     * @return
     */
    List<UserConsumptionModel> selectUserConsumptionDetail(Map<String,Object> map) throws ServiceException;
    
    /**
     * 用户消费详情统计总数
     * @param map
     * @return
     */
    long selectUserConsumptionDetailCount(Map<String,Object> map) throws ServiceException;
    
    /**
     * 渠道关注统计
     * @param radioDay
     * @param followSourceStartDate
     * @param followSourceEndDate
     * @return
     */
    Map<String, Object> selectFollowSourceChart(Integer radioDay, String followSourceStartDate,
                                             String followSourceEndDate);

}
